<template>
  <div>
    <van-nav-bar
      class="box"
      title="收藏列表"
      left-arrow="true"
      @click-left="this.$router.go(-1)"
    />
    <div class="article-page" @click="tto">
      <div class="article-item" v-for="item in info" :key="item.id">
        <div class="left">
          <img
            :src="`http://liufusong.top:8080` + item.houseImg"
            alt="图片加载失败"
          />
        </div>
        <div class="body">
          <!-- http://liufusong.top:8080/uploads/upload_907fabc90faabd08a4a33a4fc766946c.ico -->
          <h2>{{ item.price }}</h2>
          <p class="p1">{{ item.desc }}</p>
          <span>{{ item.tags[0] }}</span>
          <p class="p2">{{ item.price }}</p>
          <p class="p3">元/月</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { ShouCang } from '@/api/user'
export default {
  name: 'ShouCang',
  props: {},
  components: {},
  data () {
    return {
      info: ''
    }
  },

  async created () {
    const data = await ShouCang()
    console.log(data)
    this.info = data.body
  },
  methods: {
    tto (code) {
      this.$router.push({
        path: '/desc',
        query: {
          code
        }
      })
    }
  },
  mounted () {},
  watch: {},
  computed: {},
  filters: {}
}
</script>

<style lang="less" scoped>
#box {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  width: 100%;
  height: 50px;
  background-color: #21b97a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
input {
  width: 274px;
  height: 34px;
  border-radius: 3px;
  background: #fff;
  outline: none;
  border: 0px;
  font-size: 13px;
  color: #9c9fa3;
  padding-left: 10px;
}

#left {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #21b97a;
  font-size: 12px;
  width: 30px;
  height: 30px;
  margin-left: 10px;
}
#right {
  align-items: center;
  justify-content: center;
  display: flex;
  color: #21b97a;
  font-size: 12px;
  width: 30px;
  height: 30px;
  margin-right: 10px;
}
.collect-page {
  margin-bottom: 50px;
  margin-top: 44px;
}
.article-item {
  display: flex;
  align-content: space-between;
  border-bottom: 1px solid #ccc;
}
.left {
  // border: 2px solid red;
  width: 120px;
  height: 120px;
  img {
    width: 100%;
    height: 100%;
  }
}
.body {
  position: relative;
  // border: 2px solid red;
  height: 100px;
  width: 250px;
  h2 {
    font-size: 15px;
    position: absolute;
    left: 5px;
    top: 0px;
  }
  span {
    display: inline-block;
    background-color: #e1f5f8;
    color: #39becd;
    width: 50px;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
    position: absolute;
    left: 5px;
    top: 55px;
  }
}
.p1 {
  font-size: 12px;
  color: #afb2b3;
  position: absolute;
  left: 5px;
  top: 20px;
}
.p2 {
  position: absolute;
  left: 5px;
  top: 62px;
  color: #fa5741;
  font-size: 16px;
  font-weight: 700;
}
.p3 {
  position: absolute;
  left: 40px;
  top: 66px;
  color: #fa5741;
  font-size: 12px;
}
.pl1 {
  width: 100%;
  display: inline-block;
  top: 0;
  position: fixed;
  z-index: 999;
}
.box {
  position: fixed;
  width: 100%;
}
</style>
